/*     */ package com.lmpop.trade.ti_memreport;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_memreportInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_memreportInfo()
/*     */   {
/*  16 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  25 */     Ti_memreport ti_memreport = new Ti_memreport();
/*  26 */     ti_memreport.setInfo_id(map.getString("info_id"));
/*  27 */     ti_memreport.setUser_id(map.getString("user_id"));
/*  28 */     ti_memreport.setGoods_id(map.getString("goods_id"));
/*  29 */     ti_memreport.setCust_id(map.getString("cust_id"));
/*  30 */     ti_memreport.setContent(map.getString("content"));
/*     */ 
/*  37 */     String userrand = map.getString("userrand");
/*  38 */     String randcode = map.getString("randcode");
/*     */ 
/*  40 */     String result_code = "0";
/*  41 */     String result_info = "";
/*     */     try
/*     */     {
/*  44 */       if (userrand.trim().equals(randcode.trim())) {
/*  45 */         insert(dbmMgr, ti_memreport);
/*     */       } else {
/*  47 */         result_info = "验证码不正确，请重新输入!";
/*  48 */         result_code = "1";
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  51 */       e.printStackTrace();
/*  52 */       result_code = "1";
/*     */     }
/*  54 */     map.setString("result_code", result_code);
/*  55 */     map.setString("result_info", result_info);
/*  56 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_memreport ti_memreport)
/*     */     throws ApplicationException
/*     */   {
/*  65 */     dbmMgr.update("insertTi_memreport", ti_memreport);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  75 */     String pkid_string = map.getString("pkid");
/*  76 */     String result_code = "0";
/*     */     try {
/*  78 */       if (!pkid_string.equals("")) {
/*  79 */         String[] pkStr = pkid_string.split("\\|");
/*  80 */         for (int i = 0; i < pkStr.length; i++) {
/*  81 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  85 */       e.printStackTrace();
/*  86 */       result_code = "1";
/*     */     }
/*  88 */     map.setString("result_code", result_code);
/*  89 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  98 */     dbmMgr.update("deleteTi_memreport", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 107 */     Ti_memreport ti_memreport = new Ti_memreport();
/* 108 */     ti_memreport.setInfo_id(map.getString("info_id"));
/* 109 */     ti_memreport.setUser_id(map.getString("user_id"));
/* 110 */     ti_memreport.setGoods_id(map.getString("goods_id"));
/* 111 */     ti_memreport.setCust_id(map.getString("cust_id"));
/* 112 */     ti_memreport.setContent(map.getString("content"));
/* 113 */     ti_memreport.setIn_date(map.getString("in_date"));
/* 114 */     ti_memreport.setDeal_state(map.getString("deal_state"));
/* 115 */     ti_memreport.setDeal_user_id(map.getString("deal_user_id"));
/* 116 */     ti_memreport.setDeal_date(map.getString("deal_date"));
/* 117 */     ti_memreport.setDeal_result(map.getString("deal_result"));
/*     */ 
/* 119 */     String result_code = "0";
/*     */     try {
/* 121 */       update(dbmMgr, ti_memreport);
/*     */     } catch (ApplicationException e) {
/* 123 */       e.printStackTrace();
/* 124 */       result_code = "1";
/*     */     }
/* 126 */     map.setString("result_code", result_code);
/* 127 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_memreport ti_memreport)
/*     */     throws ApplicationException
/*     */   {
/* 136 */     dbmMgr.update("updateTi_memreport", ti_memreport);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 146 */     Map ti_memreport = (Hashtable)obj;
/* 147 */     if (start == 0)
/* 148 */       start = 0;
/*     */     else {
/* 150 */       start = (start - 1) * limit;
/*     */     }
/* 152 */     ti_memreport.put("start", Integer.valueOf(start));
/* 153 */     ti_memreport.put("limit", Integer.valueOf(limit));
/*     */ 
/* 156 */     return this.queryList.getList("getListByTi_memreportPage", ti_memreport);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 167 */     Map ti_memreport = (Hashtable)obj;
/*     */ 
/* 169 */     List list = this.queryList.getList("getCountByObjTi_memreport", ti_memreport);
/* 170 */     int count = 0;
/* 171 */     if ((list != null) && (list.size() > 0)) {
/* 172 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 173 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 174 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 177 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 189 */     return this.queryList.getList("getTi_memreportByPk", pk);
/*     */   }
/*     */ 
/*     */   public String getReportGoodsNameById(String goods_id)
/*     */   {
/* 201 */     String goods_name = "";
/* 202 */     List goodslist = this.queryList.getList("getReportGoodsNameById", goods_id);
/* 203 */     if ((goodslist != null) && (goodslist.size() > 0)) {
/* 204 */       Hashtable map = (Hashtable)goodslist.get(0);
/* 205 */       if (map.get("goods_name") != null)
/* 206 */         goods_name = map.get("goods_name").toString();
/*     */     }
/* 208 */     return goods_name;
/*     */   }
/*     */ 
/*     */   public String getReportCustNameById(String cust_id)
/*     */   {
/* 217 */     String cust_name = "";
/* 218 */     List custlist = this.queryList.getList("getReportCustNameById", cust_id);
/* 219 */     if ((custlist != null) && (custlist.size() > 0)) {
/* 220 */       Hashtable map = (Hashtable)custlist.get(0);
/* 221 */       if (map.get("cust_name") != null)
/* 222 */         cust_name = map.get("cust_name").toString();
/*     */     }
/* 224 */     return cust_name;
/*     */   }
/*     */ 
/*     */   public List getListByPageComp(Object obj, int start, int limit)
/*     */   {
/* 239 */     Map ti_memreport = (Hashtable)obj;
/* 240 */     if (start == 0)
/* 241 */       start = 0;
/*     */     else {
/* 243 */       start = (start - 1) * limit;
/*     */     }
/* 245 */     limit = start + limit;
/* 246 */     ti_memreport.put("start", Integer.valueOf(start));
/* 247 */     ti_memreport.put("limit", Integer.valueOf(limit));
/*     */ 
/* 249 */     return this.queryList.getList("getListByTi_memreportPageComp", ti_memreport);
/*     */   }
/*     */ 
/*     */   public int getCountByObjComp(Object obj)
/*     */   {
/* 260 */     Map ti_memreport = (Hashtable)obj;
/* 261 */     List list = this.queryList.getList("getCountByObjTi_memreportComp", ti_memreport);
/* 262 */     int count = 0;
/* 263 */     if ((list != null) && (list.size() > 0)) {
/* 264 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 265 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 266 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 269 */     return count;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_memreport.Ti_memreportInfo
 * JD-Core Version:    0.6.0
 */